# /usr/bin/bash

pb_file=$1

NCNN_BIN=/home/lileilei/tools/DLDeployTool/Src/ncnn-master/build/tools/
ASSET_PATH=/run/media/leilei/wdc_hb0/Project/Handguest/Deploy/handdet/app/src/main/assets/

${NCNN_BIN}tensorflow/tensorflow2ncnn $pb_file ${ASSET_PATH}hand_rec.param ${ASSET_PATH}hand_rec.bin

${NCNN_BIN}ncnnoptimize ${ASSET_PATH}hand_rec.param ${ASSET_PATH}hand_rec.bin ${ASSET_PATH}hand_rec.param ${ASSET_PATH}hand_rec.bin 1

${NCNN_BIN}ncnn2mem ${ASSET_PATH}hand_rec.param ${ASSET_PATH}hand_rec.bin ${ASSET_PATH}hand_rec.id.h ${ASSET_PATH}hand_rec.mem.h

mv ${ASSET_PATH}hand_rec.id.h ${ASSET_PATH}../cpp/
rm ${ASSET_PATH}hand_rec.mem.h
rm ${ASSET_PATH}hand_rec.param
